package cn.itsource.org.mongo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import java.util.Date;

@Document(collection = "tb_employee")
@Data
public class Employee {

    @Id
    private String _id;

    @Field(name = "user_name")
    private String username;

    private String password;
    private Integer age;

    @Field(name = "create_date",targetType = FieldType.DATE_TIME)
    private Date createDate;
}
